UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LY0No80HSo1BJnOX/erxnqurVlvgz2gtGMh/GKqeamE=' 
WHERE 
  key_id = '5884eab43ecedbdac5be8f0fa4b44c5a3a0362343b72f94f2df4512163d14a56' 
  AND (
    token = 'LY0No80HSo1BJnOX/erxnqurVlvgz2gtGMh/GKqeamE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031