UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TEgxfXmju738ZIK+H1Lcy75j8Xnat6fwYmRpMGeWP1Q=' 
WHERE 
  key_id = '4116916dafb2a2517afc95d3443e7c9762ccd17ebf1797b2b2d72e0eda213a81' 
  AND (
    token = 'TEgxfXmju738ZIK+H1Lcy75j8Xnat6fwYmRpMGeWP1Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025