UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '//8VO31Su/QhmEPHzZBQPZUeNk4COFgf3M0dK01r19Y=' 
WHERE 
  key_id = '50727fd1ffeeeec686dd8a8d1756d883a9fd7dac6fdd98b111af418979979970' 
  AND (
    token = '//8VO31Su/QhmEPHzZBQPZUeNk4COFgf3M0dK01r19Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027