UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HeUTqiILjsCEzLFxzt6hZgqYqu7IfG3DcOGTRad7Qqo=' 
WHERE 
  key_id = '6cf136f86b3a3cfd8801bc6b47f03759b83376db9188ee95ccb13bdc315c9a58' 
  AND (
    token = 'HeUTqiILjsCEzLFxzt6hZgqYqu7IfG3DcOGTRad7Qqo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031