UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ngAd/IrcYqUZ145QqJJ3LtWPmkjH6WOkT7s3Woz6egQ=' 
WHERE 
  key_id = 'b7af8c7bc2a48fb01571b59e0afd7331d3dcc244d0584dc398c3877fe860cf5e' 
  AND (
    token = 'ngAd/IrcYqUZ145QqJJ3LtWPmkjH6WOkT7s3Woz6egQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051