UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cLN+wWEHE1XOmVuT+c7DxJa81Y51bydB818u6SxIzxU=' 
WHERE 
  key_id = '619045b541eb5070dfb2a0d2d474d6a3bf0d2293c07154d2f05e7e6e22a62475' 
  AND (
    token = 'cLN+wWEHE1XOmVuT+c7DxJa81Y51bydB818u6SxIzxU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025