UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'coPNkyEMG3pVr15kza+yFgOsy1AOxL+r7VLZZvO9TDM=' 
WHERE 
  key_id = 'aef28fc519ea11c28e3bbbe0ab7b1f70066d0b710a53a225172a2ae7279428a6' 
  AND (
    token = 'coPNkyEMG3pVr15kza+yFgOsy1AOxL+r7VLZZvO9TDM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036