UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cjScfyneDljikyAR2jDlvtgfWVm0RSitIef+toa5/jc=' 
WHERE 
  key_id = 'adc8a712067ef7f50e80bff22433901c64df1a92608de2015e7a928df31d34ae' 
  AND (
    token = 'cjScfyneDljikyAR2jDlvtgfWVm0RSitIef+toa5/jc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029