UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hQR+rgNWwRklJcFkz68nFGxfNX8RPS7xPylRLlEsVq4=' 
WHERE 
  key_id = 'c90238682874ac5cdb13226bfe720d54fb7335eb8f52dd80acb11ae0df42851b' 
  AND (
    token = 'hQR+rgNWwRklJcFkz68nFGxfNX8RPS7xPylRLlEsVq4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052