UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kBbBbzCe1NdLY3axtYCnqPVL/IZNQKxZiBC7tN3SxYA=' 
WHERE 
  key_id = '3d7eaba178fe053ace1dfe9ecb1c0e15af8c76a82a7a6da9062e2d5c42ddade5' 
  AND (
    token = 'kBbBbzCe1NdLY3axtYCnqPVL/IZNQKxZiBC7tN3SxYA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050