UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mzCy6UdaBY3F6ULhMgE0vSeTQ/qdox3Q1Yh3SoY/9dQ=' 
WHERE 
  key_id = 'b15d2c65739801b4dffb741f12cf4e5cfab126ea70abb30047692671c5c331ca' 
  AND (
    token = 'mzCy6UdaBY3F6ULhMgE0vSeTQ/qdox3Q1Yh3SoY/9dQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024