UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FqAG+OBOTgWz770SO9krEUKk4SxMxePmW2Cwz5H/GiI=' 
WHERE 
  key_id = '4f9b8249b1613a382d5a4b3e5556cf0c8eacf8e75cb91e73a23a5ad3fe336b1c' 
  AND (
    token = 'FqAG+OBOTgWz770SO9krEUKk4SxMxePmW2Cwz5H/GiI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041