UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'W+/cPhAPP6UAXKwvwI01FEAFdIkqL6zyYwjiOt9HohA=' 
WHERE 
  key_id = 'e1b1707606a809966d59b0b2b3222cba67884f4f8670d74efb36fa2a577cd8bb' 
  AND (
    token = 'W+/cPhAPP6UAXKwvwI01FEAFdIkqL6zyYwjiOt9HohA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032