UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nwEp4q6xGvmf4fqOH6Vr6pN9lnP5qwy10JWGYder81s=' 
WHERE 
  key_id = '2a25564b40ec8c7c3d8a0cd2a241410b315b6868e64aff6e75d87319c0ee6abc' 
  AND (
    token = 'nwEp4q6xGvmf4fqOH6Vr6pN9lnP5qwy10JWGYder81s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018