UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4mx5sGz0HnHtZ6y+pW+k7bRXzEX/+yb6LJpYSdOCoDQ=' 
WHERE 
  key_id = '918df48ea136370e0c409ca0cd720691a328ed9e6c5d85618bf2b105dc89d895' 
  AND (
    token = '4mx5sGz0HnHtZ6y+pW+k7bRXzEX/+yb6LJpYSdOCoDQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021