UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tZ3nFnaQILs37X6eoGQmIICIxv29NtQPjZm8I/pncEQ=' 
WHERE 
  key_id = '3024108a887cf44d6efb27fa4ee18b298d3d017beae44116768344fb06c7661e' 
  AND (
    token = 'tZ3nFnaQILs37X6eoGQmIICIxv29NtQPjZm8I/pncEQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045