UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ikMnAr3erkjloh1jyEW+Yeu7YiCPeLthcWhpJxi7cPY=' 
WHERE 
  key_id = '49648a01cc15a76ce1294107ea4280560a555a7b7a07f29f7ccfa034c0280b75' 
  AND (
    token = 'ikMnAr3erkjloh1jyEW+Yeu7YiCPeLthcWhpJxi7cPY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028