UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G/ga9TefI/1GCyuYWT4UUcOiqp/96HFGQ9wkgpJC/nE=' 
WHERE 
  key_id = 'f08f3ec3b745298c0439bd23ce47cdeaaca78e247406e950a401bd48a9df2182' 
  AND (
    token = 'G/ga9TefI/1GCyuYWT4UUcOiqp/96HFGQ9wkgpJC/nE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030