UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9n06ixs2+Bik9rluTEyHpTpfr4RUzoaEayQHwbvwcuc=' 
WHERE 
  key_id = '8186ee4caf59d00706863a9aa4a79b7bd1976a0cb58779e6540682065db833b7' 
  AND (
    token = '9n06ixs2+Bik9rluTEyHpTpfr4RUzoaEayQHwbvwcuc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031