UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PLIUPWLgQMObvS4vE2aTZV4dNhNWLHHOWb7v5XnNkf8=' 
WHERE 
  key_id = '1e4e780c455dbcc81b98c35df85041d2748113d1cbce86110581d5b069f9135b' 
  AND (
    token = 'PLIUPWLgQMObvS4vE2aTZV4dNhNWLHHOWb7v5XnNkf8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00119