UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nZPe9hk5SU5bKI+EK2twmj3Jqz/f7H/E20Dvp6k0fT8=' 
WHERE 
  key_id = 'd8258b712b5a266a4b95e954d8242f4de3bab6baf40bed00d9ed8570b3d8a1b0' 
  AND (
    token = 'nZPe9hk5SU5bKI+EK2twmj3Jqz/f7H/E20Dvp6k0fT8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036