UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EUdK8cJrn6ESZtB7rQF5yqAFx+M2AkgvqJJZEheyjhk=' 
WHERE 
  key_id = 'b4c7c041f7b591657d963a88bf0845c58b0c9b2d60765c0c86950a9129e9ed1b' 
  AND (
    token = 'EUdK8cJrn6ESZtB7rQF5yqAFx+M2AkgvqJJZEheyjhk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028