UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ROIYdV5npuzGL+3cU63SLhHHaSDt3sPrNU6NNLEC+2o=' 
WHERE 
  key_id = 'ab81a34245bfb4d0c7870e1cc517dab156ea7b525ab5f9d0b5efdf21bd7de271' 
  AND (
    token = 'ROIYdV5npuzGL+3cU63SLhHHaSDt3sPrNU6NNLEC+2o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036