UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cVw+894/QQO2jYo9AVzBBwuxZtzP2FRt9gElVmgG5co=' 
WHERE 
  key_id = '9bb2be2390d509ddbc075f189d26834a684860ee7b6152a4a41f3f6308107433' 
  AND (
    token = 'cVw+894/QQO2jYo9AVzBBwuxZtzP2FRt9gElVmgG5co=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00064