UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J3DABCJXm9f9rAxR9G+671g2PEWeQGK1NS8c27ypuPc=' 
WHERE 
  key_id = '721ea809a01c5d9e601d4cd9a9f653c5fa8f98088be957719a39cad2819eb30d' 
  AND (
    token = 'J3DABCJXm9f9rAxR9G+671g2PEWeQGK1NS8c27ypuPc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022