UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lsdGIvqTizyPzFo67JK8wOUsvU8UYWRD05CaWm/bnfE=' 
WHERE 
  key_id = '0b356ea11d5822aacc7006f538e6faedefd73138530cc524f42f7550681d8463' 
  AND (
    token = 'lsdGIvqTizyPzFo67JK8wOUsvU8UYWRD05CaWm/bnfE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030