UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vn9aVl3WkNbYdgIx+2atb1DpR+XtGcwNqKkgOCfUvtE=' 
WHERE 
  key_id = '9e1d411492b7a2dc574e89fb9d5c541de2db81d222b0bc2e7a38e7bd90bc4994' 
  AND (
    token = 'Vn9aVl3WkNbYdgIx+2atb1DpR+XtGcwNqKkgOCfUvtE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019