UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EBGxymFQcezgWFuYrcsT4tF6CkJlaPAbSCUpmjZ3M1c=' 
WHERE 
  key_id = '79c409e89f69860e7a9fd80ea91f5afa046bd301d52cd35c407fe42eebb10793' 
  AND (
    token = 'EBGxymFQcezgWFuYrcsT4tF6CkJlaPAbSCUpmjZ3M1c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017