UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DeTHnmzmq9RSuWcLkKbMSE0ySHgavNtmEA/fj/wmRBg=' 
WHERE 
  key_id = '37c53dacfc02531b9f2d5d00b1e68bc1e949012882cafc65889c05d3a021ed6b' 
  AND (
    token = 'DeTHnmzmq9RSuWcLkKbMSE0ySHgavNtmEA/fj/wmRBg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042