UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'O/pxXBy8QBAklXLRHVkpYVCOKvoA7+IFIgdGbRCfUP8=' 
WHERE 
  key_id = 'f0b29d42e24e5eb2354478e2a1f8aced3ff92c555e62a92aad8e04d84cb393c8' 
  AND (
    token = 'O/pxXBy8QBAklXLRHVkpYVCOKvoA7+IFIgdGbRCfUP8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014