UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fV9M/X0fqDfuZ2hEqSTH6QipxnpUHFgAbmeE9j2R31M=' 
WHERE 
  key_id = 'e3dcc634b7fe4180173773c4dd8cc3dc6de4030382bf895d9c0e7a1aaa77028d' 
  AND (
    token = 'fV9M/X0fqDfuZ2hEqSTH6QipxnpUHFgAbmeE9j2R31M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032